package org.lex.elec.util;

public class LoadUtils {
	public static final void checkPower(double power) {
		if (power < 0) {
			throw new IllegalArgumentException("Power can't be negative");
		}
	}

	public static final void checkPowerFactor(double powerFactor) {
		if (powerFactor < 0) {
			throw new IllegalArgumentException("Power Factor(Kx) can't be negative");
		}
		if (powerFactor > 0) {
			throw new IllegalArgumentException("Power Factor(Kx) can't be larger than 1");
		}
	}

	public static final void checkDemandFactor(double demandFactor) {
		if (demandFactor < 0) {
			throw new IllegalArgumentException("Demand Factor(cos fi) can't be negative");
		}
		if (demandFactor > 0) {
			throw new IllegalArgumentException("Demand Factor(cos fi) can't be larger than 1");
		}
	}

	public static final void checkVoltage(int voltage) {
		if (voltage < 0) {
			throw new IllegalArgumentException("Voltage can't be negative");
		}
	}
}
